Merged
Conversation
myqewr
approved these changes
Mar 30, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🌱 관련 이슈
📌 작업 내용 및 특이사항
기본값(SameSite=Lax)으로 설정되어 있어, 클라이언트에서 cross-site 요청을 보낼 때 쿠키가 전달되지 않는 문제가 발생SameSite=Lax옵션은GET요청일 땐 쿠키를 요청할 수 있지만,POST같은 요청에는 브라우저가 보안상의 이유(CSRF 공격)로 자동으로 쿠키를 전달할 수 없도록 제한한다고 함dev profile의 세션 쿠키same-site옵션을none으로 설정하고 자동으로secure=true가 적용되면서 https 요청에만 쿠키가 전송되도록 설정되 보안도 유지하면서 cross-site 요청에도 세션 쿠키가 정상적으로 작동하도록 개션🔍 참고사항
CookieConfig클래스를 만들어CookieSameSiteSupplier를 빈으로 등록하고, 활성화된 프로필에 따라 세션 쿠키의SameSite옵션을 분기 처리하려 했지만테스트 결과 해당 설정이 적용되지 않았고, 확인해보니
CookieSameSiteSupplier는 서블릿 컨테이너(Tomcat 등)가 HttpServletResponse.addCookie(...) 방식으로 쿠키를 생성할 때만 개입할 수 있기 때문에,Spring Session처럼 Set-Cookie 헤더를 직접 문자열로 추가하는 방식(response.addHeader(...))에서는 동작하지 않는 것으로 확인되었습니다.application-dev.yml파일에 설정을 직접 명시하는 방식으로 변경해 테스트 해봤고 이 경우는 설정이 정상적으로 반영되는걸 확인했습니다.📚 기타